package scanner;

public class Token
{
    private TokenId id;
    private Object data;

    public Token(TokenId id, Object data)
    {
        this.id = id;
        this.data = data;
    }

    public Token(TokenId id)
    {
        this.id = id;
    }

    public TokenId GetId()
    {
        return id;
    }

    public Object GetData()
    {
        return data;
    }

    public String toString()
    {
        String str = "<" + id;
        str += (data != null) ? (", " + data) : "";
        str += ">";
        return str;
    }

}
